<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript">
        //日期的正则表达式

        $(function() {
            $("#upd").submit(function () {

                var enumber=$("#enumber").val();
                var reg=/(QC)[0-9,a-z,A-Z]/
                if(reg.test(enumber)==false){
                    $("#enumbers").html("设备编号:必须以QC开头");
                    return false;
                }
                $("#enumbers").html();
                });
            $("[value=修改]").click(function () {
                var ss=true;
                if(ss==true){
                    layer.alert("修改成功", {icon: 6})

                }if(ss==false){
                    layer.alert("修改失败", {icon: 6})
                }
            });
            });

    </script>
</head>

<body>

<div class="x-body">

    <form class="layui-form" id="upd"  action="Servletupd" method="post">

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>设备id
            </label>
            <div class="layui-input-inline">
                <input type="text" id="eid" name="eid" required="" lay-verify="eid" value="${names.eid}" readonly="readonly"
                       autocomplete="off" class="layui-input">
                <span id="eids" class="aa"></span>
            </div>
        </div>


        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>设备编码
            </label>
            <div class="layui-input-inline">
                <input type="text" id="enumber" name="enumber" required="" lay-verify="enumber" value="${names.enumber}"
                       autocomplete="off" class="layui-input">
                <span id="enumbers" class="aa"></span>
            </div>
        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>生产日期
            </label>
            <div class="layui-input-inline">
                <input type="date" id="manufactureTime" name="manufactureTime" required="" lay-verify="manufactureTime"
                       value="${names.manufactureTime}"   autocomplete="off" class="layui-input">
                <span id="manufactureTimes" class="aa"></span>
            </div>
        </div>
        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>用户
            </label>
            <div class="layui-input-inline">

                <select name="userid">
                    <option value="${names.userid}">${names.userid}</option>
                    <c:forEach  items="${listl}" var="t">

                        <option value="${t.uid}">${t.uname}</option>

                    </c:forEach>
                </select>
                <span id="userids" class="aa"></span>
            </div>
        </div>
        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>净水器
            </label>
            <div class="layui-input-inline">
                <select name="wpid" class="a">
                    <option value="${names.wpid}">${names.wpid}</option>
                    <c:forEach  items="${listk}" var="p">

                        <option value="${p.wpid}">${p.waterName}</option>

                    </c:forEach>
                </select>
                <span id="wpids" class="aa"></span>
            </div>
        </div>


        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>是否装机
            </label>
            <div class="layui-input-inline">
                <select name="install"  class="b">
                    <option value="${names.install}">${names.install}</option>
                    <option value="0">0未装机</option>
                    <option value="1">1已装机</option>
                </select>
                <span id="installs" class="aa"></span>
            </div>
        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>分配时间
            </label>
            <div class="layui-input-inline">
                <input type="date" id="allocationDate" name="allocationDate" required="" lay-verify="allocationDate"
                       value="${names.allocationDate}"  autocomplete="off" class="layui-input">
                <span id="allocationDates" class="aa"></span>
            </div>
        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
            </label>
            <input  class="layui-btn" lay-filter="add" lay-submit="" type="submit" value="修改"/>
        </div>
    </form>
</div>
<script>

        //监听提交

</script>
<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>

</html>